<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
		<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
		<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
		<script> var weburl = '{yun:}$config.sy_weburl{/yun}';</script>
		<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
		<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
		<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
		<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
		<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>

		<title>后台管理</title>
	</head>
	<body class="body_ifm">
		<div class="infoboxp">

			<div class="admin_new_tip">
				<a href="javascript:;" class="admin_new_tip_close"></a>
				<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
				<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
				<div class="admin_new_tip_list_cont">
					<div class="admin_new_tip_list">添加专题：主要为了满足运营者运营需求，运营者可以举办行业或个性化招聘主题招聘活动。</div>
				</div>
			</div>
			<div class="clear"></div>

			<div class="tag_box mt10">
				<iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
				<form id="spform" class="layui-form" name="myform" target="supportiframe" action="index.php?m=special&c=save"
				 method="post" encType="multipart/form-data">
					<table width="100%" class="table_form" style="background:#fff;">
						<tr class="admin_table_trbg">
							<th colspan="2" bgcolor="#f0f6fb"><span class="admin_bold">添加专题招聘</span></th>
						</tr>
						<tr>
							<th width="150">专题名称：</th>
							<td><input class="input-text" type="text" id="title" name="title" size="40" value="{yun:}$row.title{/yun}" /></td>
						</tr>
						<tr class="admin_table_trbg">
							<th>企业报名上限：</th>
							<td><input class="input-text" type="text" name="limit" value="{yun:}$row.limit{/yun}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" /><span
								 class="admin_web_tip">例：最多可有多少家企业报名</span></td>
						</tr>
						<tr>
							<th>企业等级：</th>
							{yun:}if is_array($qy_rows){/yun}
							<td>
								<div class="layui-form-item">
									<div class="layui-input-block">
										{yun:}foreach item=v from=$qy_rows{/yun}
										<input name="rating[]" title="{yun:}$v.name{/yun}" value="{yun:}$v.id{/yun}" {yun:}if
										 in_array($v.id,$row.rating){/yun} checked="checked" {yun:}/if{/yun} type="checkbox">
										{yun:}/foreach{/yun}
									</div>
								</div>
							</td>
							{yun:}else{/yun}
							<td>
								暂无等级，<a href="index.php?m=userconfig&c=comclass" style="color:red;">添加会员等级</a>
								<input type="hidden" name="rating" value="0">
							</td>
							{yun:}/if{/yun}
						</tr>
						<tr class="admin_table_trbg">
							<th>专题模板：</th>
							<td>
								<div class="layui-form-item">
									<div class="layui-input-block">
										<div class="layui-input-inline">
											<select name="tpl" lay-filter="" id="tpl">
												<option value=''>请选择</option>
												{yun:}foreach from=$file item=ratlist{/yun}
												<option value="{yun:}$ratlist{/yun}" {yun:}if $row.tpl==$ratlist{/yun} selected {yun:}/if{/yun}>{yun:}$ratlist{/yun}</option>
												{yun:}/foreach{/yun}
											</select>
										</div>
										<span class="admin_web_tip">选择的模板类型只在PC版生效，其他端有专用模板</span>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<th>是否启用：</th>
							<td>
								<div class="iradio_flat_height">
									<div class="layui-form-item">
										<div class="layui-input-block">
											<input type="radio" name="display" value="1" title="开启" {yun:}if $row.display=='1' ||$row.display=="" {/yun}checked{yun:}/if{/yun}>
											<input type="radio" name="display" value="0" title="关闭" {yun:}if $row.display=='0' {/yun}checked{yun:}/if{/yun}>
										</div> 
									</div>
								</div>
							</td> 
						</tr> 
						<tr class="admin_table_trbg">
							<th>允许企业报名：</th>
							<td>
								<div class="layui-form-item">
									<div class="layui-input-block">
										<input type="radio" name="com_bm" value="1" title="开启" {yun:}if $row.com_bm=='1' ||$row.com_bm=="" {/yun}checked{yun:}/if{/yun}>
										<input type="radio" name="com_bm" value="0" title="关闭" {yun:}if $row.com_bm=='0' {/yun}checked{yun:}/if{/yun}>
									</div> 
								</div> 
							</td> 
						</tr> 
						<tr>
							<th>扣除{yun:}$config.integral_pricename{/yun}：</th>
							<td>
								<input class="input-text" type="text" id="php_url" name="integral" value="{yun:}$row.integral{/yun}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" />
							</td>
						</tr>
						<tr class="admin_table_trbg">
							<th width="120">报名结束时间：</th>
							<td>
								<input id="etime" class="input-text" type="text" readonly size="20" value="{yun:}$row.etime|date_format:'%Y-%m-%d'{/yun}" name="etime"/>
							</td>
						</tr>
						<tr class="admin_table_trbg">
							<th>排序：</th>
							<td><input class="input-text" type="text" name="sort" value="{yun:}$row.sort{/yun}" /><span class="admin_web_tip">越小越在前!</span></td>
						</tr>
						<tr>
							<th>缩 略 图：</th>
							<td>
								<button type="button" class="yun_bth_pic noupload" lay-data="{imgid: 'imgpic',parentid: 'picdiv'}">上传图片</button>
								<input type="hidden" id="laynoupload" value="1" />
							</td>
						</tr>
						<tr id="picdiv" class="admin_table_trbg {yun:}if !$row.pic{/yun}none{yun:}/if{/yun}">
							<th>缩略图预览：</th>
							<td><img src="{yun:}$row.pic{/yun}" style="width:420px;height:155px;" id="imgpic"></td>
						</tr>
						<tr>
							<th>背 景 图：</th>
							<td>
								<button type="button" class="yun_bth_pic noupload2" lay-data="{imgid: 'imgbackground',parentid: 'backgrounddiv'}">上传图片</button>
							</td>
						</tr>
						<tr id="backgrounddiv" class="admin_table_trbg {yun:}if !$row.background{/yun}none{yun:}/if{/yun}">
							<th>背景图预览：</th>
							<td><img src="{yun:}$row.background{/yun}" style="max-height:288px;max-width:288px;" id="imgbackground"></td>
						</tr>
						<tr class="admin_table_trbg">
							<th>专题介绍：</th>
							<td>
								<script id="myEditor" name="intro" type="text/plain" style="width:400px;height:150px;">{yun:}$row.intro{/yun}</script>
							</td>
						</tr>
						<tr>
							<td align="center" colspan="2">
								<input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
								{yun:}if is_array($row){/yun}
								<input type="hidden" name="id" size="40" value="{yun:}$row.id{/yun}" />
								<input class="layui-btn layui-btn-normal" type="button" onclick="checkform()" value="&nbsp;更 新&nbsp;" />
								{yun:}else{/yun}
								<input class="layui-btn layui-btn-normal" type="button" onclick="checkform()" value="&nbsp;添 加&nbsp;" />
								{yun:}/if{/yun}
								<input class="layui-btn layui-btn-normal" type="reset" name="reset" value="&nbsp;重 置 &nbsp;" />
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>

		<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
		<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script>
		<script language="javascript">
			layui.use(['layer', 'form', 'laydate'], function() {
				var layer = layui.layer,
					form = layui.form,
					laydate = layui.laydate,
					$ = layui.$;
				laydate.render({
					elem: '#etime'
				});
			});

			function checkform(myform) {
				if ($("#title").val() == "") {
					parent.layer.msg('请填写专题名称！', 2, 8);
					return false;
				}
				if ($("#tpl").val() == "") {
					parent.layer.msg('请选择专题模板！', 2, 8);
					return false;
				}
				if ($("#pic").val() == "") {
					parent.layer.msg('请选择缩略图！', 2, 8);
					return false;
				}
				if ($("#background").val() == "") {
					parent.layer.msg('请选择背景图！', 2, 8);
					return false;
				}
				$("#spform").submit();
			}

			layui.use('upload', function() {
				var $ = layui.$,
					upload = layui.upload,
					layer = layui.layer,
					device = layui.device();

				var laynoupload = $("#laynoupload").val(); //1、选完不上传            
				//选完不上传，url暂未用到，只是需要其样式

				if (laynoupload == 1) {
					var layfiletype = $("#layfiletype").val();
					//上传文件类型
					if (layfiletype == 2) {
						var layaccept = 'file',
							layexts = 'doc|docx|rar|zip|pdf';
					} else {
						var layaccept = 'images',
							layexts = 'jpg|png|gif|bmp|jpeg';
					}
					upload.render({
						elem: '.noupload',
						auto: false,
						bindAction: '#test9' //触发上传的对象，暂未用到
							,
						accept: layaccept,
						field: 'sl',
						exts: layexts,
						choose: function(obj) {
							if (this.imgid) {
								//预读本地文件示例，不支持ie8/9
								var imgid = null,
									parentid = null;
								if (this.imgid) {
									imgid = this.imgid;
								}
								if (this.parentid) {
									parentid = this.parentid;
								}
								obj.preview(function(index, file, result) {
									if (parentid && $('#' + parentid).length > 0) {
										$('#' + parentid).removeClass('none');
										$('#' + imgid).attr('src', result);
									} else if (imgid && $('#' + imgid).length > 0) {
										$('#' + imgid).removeClass('none');
										$('#' + imgid).attr('src', result); //图片链接（base64）
									}

								});
							}
						}
					});
					upload.render({
						elem: '.noupload2',
						auto: false,
						bindAction: '#test9' //触发上传的对象，暂未用到
							,
						accept: layaccept,
						field: 'bg',
						exts: layexts,
						choose: function(obj) {
							if (this.imgid) {
								//预读本地文件示例，不支持ie8/9
								var imgid = null,
									parentid = null;
								if (this.imgid) {
									imgid = this.imgid;
								}
								if (this.parentid) {
									parentid = this.parentid;
								}
								obj.preview(function(index, file, result) {
									if (parentid && $('#' + parentid).length > 0) {
										$('#' + parentid).removeClass('none');
										$('#' + imgid).attr('src', result);
									} else if (imgid && $('#' + imgid).length > 0) {
										$('#' + imgid).removeClass('none');
										$('#' + imgid).attr('src', result); //图片链接（base64）
									}

								});
							}
						}
					});
				}

			});
			var ue = UE.getEditor('myEditor', {
				toolbars: [
					['justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', 'subscript',
						'superscript', '|', 'Bold', 'italic', 'underline', 'strikethrough', 'removeformat'
					]
				],
				wordCount: false,
				elementPathEnabled: false,
				initialFrameHeight: 150
			});
		</script>
	</body>
</html>
